package cn.gov.pbc.gd.credit.user.service.privilegeuser.impl;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.liu.jbase.PageListVo;
import com.liu.jbase.ResultVo;
import com.liu.jbase.annotation.LogAnnotation;
import com.liu.jbase.service.impl.BaseServiceImpl;

import cn.gov.pbc.gd.credit.api.privilegeuser.IPrivilegeUserApi;
import cn.gov.pbc.gd.credit.common.constant.CodeConstant;
import cn.gov.pbc.gd.credit.common.constant.LogConstant;
import cn.gov.pbc.gd.credit.user.service.privilegeuser.IPrivilegeUserService;
import cn.gov.pbc.gd.credit.vo.privilegeuser.PrivilegeUserVo;
import cn.gov.pbc.gd.credit.vo.privilegeuser.ResPrivilegeUserVo;

@Service
public class PrivilegeUserServiceImpl extends BaseServiceImpl<ResPrivilegeUserVo, PrivilegeUserVo, IPrivilegeUserApi> implements IPrivilegeUserService{

	
	@Autowired
	private IPrivilegeUserApi PrivilegeUserApi;

	
	@Override
	public ResultVo<PageListVo<ResPrivilegeUserVo>> page(PrivilegeUserVo record, PageListVo<ResPrivilegeUserVo> page, HttpServletRequest request) {
		
		ResultVo<PageListVo<ResPrivilegeUserVo>> resultVo = new ResultVo<>();
		
		resultVo.setCode(CodeConstant.SUCCESS);
		PageListVo<ResPrivilegeUserVo> PrivilegeUser= PrivilegeUserApi.page(record, page);
		resultVo.setData(PrivilegeUser);
		return resultVo;
	}
	
	@LogAnnotation(moduleName=LogConstant.MODULE_PRIVILEGE_USER, option=LogConstant.ADD, logType=LogConstant.LOG_OPERATE, content="添加授权用户")
	@Override
	public ResultVo<ResPrivilegeUserVo> add(PrivilegeUserVo record, HttpServletRequest request) {
		return super.add(record, request);
	}
	@LogAnnotation(moduleName=LogConstant.MODULE_PRIVILEGE_USER, option=LogConstant.UPDATE, logType=LogConstant.LOG_OPERATE, content="修改授权用户")
	@Override
	public ResultVo<ResPrivilegeUserVo> update(PrivilegeUserVo record, HttpServletRequest request) {
		// TODO Auto-generated method stub
		return super.update(record, request);
	}
	@LogAnnotation(moduleName=LogConstant.MODULE_PRIVILEGE_USER, option=LogConstant.DEL, logType=LogConstant.LOG_OPERATE, content="删除授权用户")
	@Override
	public ResultVo<ResPrivilegeUserVo> delete(PrivilegeUserVo record, HttpServletRequest request) {
		// TODO Auto-generated method stub
		return super.delete(record, request);
	}
	
}
